package org.jarraiders.musiclibrary.client.event;

import org.jarraiders.musiclibrary.shared.domain.AlbumDTO;

import com.google.gwt.event.shared.GwtEvent;

public class AlbumUpdatedEvent extends GwtEvent<AlbumUpdatedEventHandler>{
  public static Type<AlbumUpdatedEventHandler> TYPE = new Type<AlbumUpdatedEventHandler>();
  private final AlbumDTO updatedAlbum;
  
  public AlbumUpdatedEvent(AlbumDTO result) {
    this.updatedAlbum = result;
  }
  
  public AlbumDTO getUpdatedAlbum() { return updatedAlbum; }
  

  @Override
  public Type<AlbumUpdatedEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(AlbumUpdatedEventHandler handler) {
    handler.onAlbumUpdated(this);
  }
}
